Aladdin Wire Protocol

This document describes the wire protocol used by NBLS and ABLS.  The protocol uses XML documents and associated schemas to validate syntax.

Contents

Aladdin Wire Protocol 1

Contents. 1

XML Document Descriptions. 1

IABLSAdmin Interface. 2

RegisterLocaleMetadata() 2

GetLocalMetadata() 2

SetLocaleInfo() 2

RemoveLocaleInfo() 3

GetLocaleInfo() 4

GetAllLocales() 4

SetDeviceInfo() 5

RemoveDeviceInfo() 5

GetDeviceInfo() 6

GetAllDevices() 6

SetModuleInfo() 6

RemoveModuleInfo() 7

GetModuleInfo() 7

GetAllModules() 8

RegisterABLSSubscribableTypes() 8

RemoveABLSSubscribableType() 9

GetAllABLSSubscribableTypes() 9

IABLSServices Interface. 10

X10Update. 10

PeripheralUpdate() 11

RemoveEntries() 12

Lookup() 12

SubscribeEvents() 14

SubscribeWithQuery() 15

UnsubscribeEvents() 16

INBLSServices Interface. 16

Announce() 16

Revoke() 17

Lookup() 17

XML Schema. 18

Appendix 1: XML Variants. 23

HRESULT WriteVARIANTToDOMDocument( IXMLDOMNode* pNode ); 23

HRESULT ReadVARIANTFromDOMDocument( IXMLDOMNode* pNode ); 24

VARIANT Schema. 24

 

XML Document Descriptions

This section outlines the packets that are sent between the ABLS client and server, followed by the NBLS client and server.  It is modeled using a request/response asynchronous protocol where each request-response pair is uniquely identified by a GUID.  Each request-response pair corresponds to a given method exposed via the ABLS and NBLS COM interfaces given below.

 

Note that all XML documents below are prefixed with the following line:

 

<?xml version="1.0"?>

 

The text delineated by the, "[...]" or "{…}" are comments that describes the anticipated content of the field.

IABLSAdmin Interface

RegisterLocaleMetadata()

 

Request:

<ABLSRequest id="{unique guid}">

      <Metadata action="register"

            <LocaleName>[entry #1]</LocaleName>

            <LocaleName>[entry #2]</LocaleName>

                  :

                  :

      </Metadata>

</ABLSRequest>

 

Response:

<ABLSResponse id="{guid from request}">

      <Metadata action="register">

            <HRESULTS overall="[hr]">

                  <HR>[hr for entry #1]</HR>

                  <HR>[hr for entry #2]</HR>

                        :

                        :

            </HRESULTS>

      </Metadata>

</ABLSResponse>

 

GetLocalMetadata()

 

Request:

<ABLSRequest id="{unique guid}">

      <Metadata action="get_all"/>

</ABLSRequest>

 

Response:

<ABLSResponse id="{guid from request}">

      <Metadata action="get_all">

            <HR>[hr]</HR>

            <LocaleName>[entry #1]</LocaleName>

            <LocaleName>[entry #2]</LocaleName>

                  :

                  :

      </Metadata>

</ABLSResponse>

 

SetLocaleInfo()

 

Request:

<ABLSRequest id="{unique guid}">

      <LocaleInfo action="set">

            <Locale>

                  <LocaleName>[name of entry associated with the pairs]</LocaleName>

                  <NameValuePair>

                        <Name>[name #1]</Name>

                        <Value>[value #1]</Value>

                  </NameValuePair>              

                  <NameValuePair>

                        <Name>[name #2]</Name>

                        <Value>[value #2]</Value>

                  </NameValuePair>              

                        :

            </Locale>

            <Locale>

                  <LocaleName>[name of entry associated with the pairs]</LocaleName>

                  <NameValuePair>

                              :

            </Locale>

                  :

                  :

      </LocaleInfo>

</ABLSRequest>

 

Response:

<ABLSResponse id="{guid from request}">

      <LocaleInfo action="set">

            <HRESULTS overall="[hr]">

                  <HR>[hr for locale #1]</HR>

                  <HR>[hr for locale #2]</HR>

                        :

                        :

            </HRESULTS>

      </LocaleInfo>

</ABLSResponse>

 

RemoveLocaleInfo()

 

Request:

<ABLSRequest id="{unique guid}">

      <LocaleInfo action="remove">

            <LocaleName>[name of locale to be removed]</LocaleName>

      </LocaleInfo>

</ABLSRequest>

 

Response:

<ABLSResponse id="{guid from request}">

      <LocaleInfo action="remove">

            <HR>[hr]</HR>

      </LocaleInfo>

</ABLSResponse>

 

GetLocaleInfo()

 

Request:

<ABLSRequest id="{unique guid}">

      <LocaleInfo action="get">

            <LocaleName>[name of locale to be returned]</LocaleName>

      </LocaleInfo>

</ABLSRequest>

 

Response:

<ABLSResponse id="{guid from request}">

      <LocaleInfo action="get">

            <HR>[hr]</HR>

            <Locale>

                  <LocaleName>[name of entry associated with the pairs]</LocaleName>

                  <NameValuePair>

                        <Name>[name #1]</Name>

                        <Value>[value #1]</Value>

                  </NameValuePair>              

                  <NameValuePair>

                        <Name>[name #2]</Name>

                        <Value>[value #2]</Value>

                  </NameValuePair>              

                        :

                        :

            </Locale>

      </LocaleInfo>

</ABLSResponse>

 

GetAllLocales()

 

Request:

<ABLSRequest id="{unique guid}">

      <LocaleInfo action="get_all"/>

</ABLSRequest>

 

Response:

<ABLSResponse id="{guid from request}">

      <LocaleInfo action=" get_all">

            <HR>[hr]</HR>

            <Locale>

                  <LocaleName>[name of entry associated with the pairs]</LocaleName>

                  <NameValuePair>

                        <Name>[name #1]</Name>

                        <Value>[value #1]</Value>

                  </NameValuePair>              

                  <NameValuePair>

                        <Name>[name #2]</Name>

                        <Value>[value #2]</Value>

                  </NameValuePair>              

                        :

            </Locale>

            <Locale>

                  <LocaleName>[name of entry associated with the pairs]</LocaleName>

                  <NameValuePair>

                        :

            </Locale>

                  :

                  :

      </LocaleInfo>

</ABLSResponse>

 

SetDeviceInfo()

 

Request:

<ABLSRequest id="{unique guid}">

      <DeviceInfo action="set">

            <Device>

                  <DeviceCode>[device code as DWORD]</DeviceCode>

                  <DeviceName>[name of device]</DeviceName>

            </Device>

            <Device>

                  <DeviceCode>[device code as DWORD]</DeviceCode>

                  <DeviceName>[name of device]</DeviceName>

            </Device>

                  :

                  :

      </DeviceInfo>

</ABLSRequest>

 

Response:

<ABLSResponse id="{guid from request}">

      <DeviceInfo action="set">

            <HR>[hr]</HR>

      </DeviceInfo>

</ABLSResponse>

 

RemoveDeviceInfo()

 

Request:

<ABLSRequest id="{unique guid}">

      <DeviceInfo action="remove">

            <DeviceName>[name of device to be removed]</DeviceName>

      </DeviceInfo>

</ABLSRequest>

 

Response:

<ABLSResponse id="{guid from request}">

      <DeviceInfo action="remove">

            <HR>[hr]</HR>

      </DeviceInfo>

</ABLSResponse>

 

GetDeviceInfo()

 

Request:

<ABLSRequest id="{unique guid}">

      <DeviceInfo action="get">

            <DeviceName>[name of device to be returned]</DeviceName>

      </DeviceInfo>

</ABLSRequest>

 

Response:

<ABLSResponse id="{guid from request}">

      <DeviceInfo action="get">

            <HR>[hr]</HR>

            <Device>

                  <DeviceCode>[device code as DWORD]</DeviceCode>

                  <DeviceName>[name of device]</DeviceName>

            </Device>

      </DeviceInfo>

</ABLSResponse>

 

 

GetAllDevices()

 

Request:

<ABLSRequest id="{unique guid}">

      <DeviceInfo action="get_all"/>

</ABLSRequest>

 

Response:

<ABLSResponse id="{guid from request}">

      <DeviceInfo action="get_all">

            <HR>[hr]</HR>

            <Device>

                  <DeviceCode>[device code as DWORD]</DeviceCode>

                  <DeviceName>[name of device]</DeviceName>

            </Device>

            <Device>

                  <DeviceCode>[device code as DWORD]</DeviceCode>

                  <DeviceName>[name of device]</DeviceName>

            </Device>

                  :

                  :

      </DeviceInfo>

</ABLSResponse>

 

SetModuleInfo()

 

Request:

<ABLSRequest id="{unique guid}">

      <ModuleInfo action="set">

            <Module>

                  <ModuleType>[module type as DWORD]</ModuleType>

                  <CLSID>{clsid of module}</CLSID>

                  <IID>{iid of module}</IID>

            </Module>

            <Module>

                  <ModuleType>[module type as DWORD]</ModuleType>

                  <CLSID>{clsid of module}</CLSID>

                  <IID>{iid of module}</IID>

            </Module>

                  :

                  :

      </ModuleInfo>

</ABLSRequest>

 

Response:

<ABLSResponse id="{guid from request}">

      <ModuleInfo action="set">

            <HR>[hr]</HR>

      </ModuleInfo>

</ABLSResponse>

 

RemoveModuleInfo()

 

Request:

<ABLSRequest id="{unique guid}">

      <ModuleInfo action="remove">

            <ModuleType>[module type as DWORD]</ModuleType>

      </ModuleInfo>

</ABLSRequest>

 

Response:

<ABLSResponse id="{guid from request}">

      <ModuleInfo action="remove">

            <HR>[hr]</HR>

      </ModuleInfo>

</ABLSResponse>

 

GetModuleInfo()

 

Request:

<ABLSRequest id="{unique guid}">

      <ModuleInfo action="get">

            <ModuleType>[module type as DWORD]</ModuleType>

      </ModuleInfo>

</ABLSRequest>

 

Response:

<ABLSResponse id="{guid from request}">

      <ModuleInfo action="get">

            <HR>[hr]</HR>

            <Module>

                  <ModuleType>[module type as DWORD]</ModuleType>

                  <CLSID>{clsid of module}</CLSID>

                  <IID>{iid of module}</IID>

            </Module>

      </ModuleInfo>

</ABLSResponse>

 

 

GetAllModules()

 

Request:

<ABLSRequest id="{unique guid}">

      <ModuleInfo action="get_all"/>

</ABLSRequest>

 

Response:

<ABLSResponse id="{guid from request}">

      <ModuleInfo action="get_all">

            <HRESULTS overall="[hr]"/>

            <Module>

                  <ModuleType>[module type as DWORD]</ModuleType>

                  <CLSID>{clsid of module}</CLSID>

                  <IID>{iid of module}</IID>

            </Module>

            <Module>

                  <ModuleType>[module type as DWORD]</ModuleType>

                  <CLSID>{clsid of module}</CLSID>

                  <IID>{iid of module}</IID>

            </Module>

                  :

                  :

      </ModuleInfo>

</ABLSResponse>

RegisterABLSSubscribableTypes()

 

Request:

<ABLSRequest id="{unique guid}">

      <SubscribableType action="register">

            <TypeEntry>

                  <Type>[type #1]</Type>

                  <ParentType>[parent #1]</ParentType>

            </TypeEntry>

            <TypeEntry>

                  <Type>[type #2]</Type>

                  <ParentType>[parent #2]</ParentType>

            </TypeEntry>

                  :

                  :

      </SubscribableType>

</ABLSRequest>

 

Response:

<ABLSResponse id="{guid from request}">

      <SubscribableType action="register">

            <HRESULTS overall="[hr]">

                  <HR>[hr for entry #1]</HR>

                  <HR>[hr for entry #2]</HR>

                        :

                        :

            </HRESULTS>

      </ SubscribableType >

</ABLSResponse>

 

RemoveABLSSubscribableType()

 

Request:

<ABLSRequest id="{unique guid}">

      <SubscribableType action="remove">

            <Type>[type]</Type>

      </SubscribableType>

</ABLSRequest>

 

Response:

<ABLSResponse id="{guid from request}">

      <SubscribableType action="remove">

            <HR>[hr]</HR>

      </SubscribableType>

</ABLSResponse>

 

GetAllABLSSubscribableTypes()

 

Request:

<ABLSRequest id="{unique guid}">

      <SubscribableType action="get_all"/>

</ABLSRequest>

 

Response:

<ABLSResponse id="{guid from request}">

      <SubscribableType action=" get_all">

            <HR>[hr]</HR>

            <TypeEntry>

                  <Type>[type #1]</Type>

                  <ParentType>[parent #1]</ParentType>

            </TypeEntry>

            <TypeEntry>

                  <Type>[type #2]</Type>

                  <ParentType>[parent #2]</ParentType>

            </TypeEntry>

                  :

                  :

      </SubscribableType>

</ABLSResponse>

 

IABLSServices Interface

X10Update

 

Request:

<ABLSRequest id="{unique guid}">

      <UpdateInfo type="x10">

            <Update>

                  <DeviceCode>[device code as DWORD]</DeviceCode>

                  <ModuleType>[module types as DWORD]</ModuleType>

                  <LocaleName>[x10 address]</LocaleName>

                  <MachineName>[machine name]</MachineName>

                  <NBLSName>[NBLS announce name]</NBLSName>

                  <ExtendedAttributes>[list of extended attributes]</ExtendedAttributes>

                  <Type>[subscribable type]</Type>

                  <Timeout>

                        <Interval>[heartbeat interval as ULONG]</Interval>

                        <Beats>[max missed heartbeats until timeout]</Beats>

                  </Timeout>

                  <VARIANT xmlns="x-schema:AladdinVariant">

                        XML Variant type as described in XML Schema

                  </VARIANT>

            </Update>

            <Update>

                  <DeviceCode>[device code as DWORD]</DeviceCode>

                  <ModuleType>[module types as DWORD]</ModuleType>

                  <LocaleName>[x10 address]</LocaleName>

                  <MachineName>[machine name]</MachineName>

                  <NBLSName>[NBLS announce name]</NBLSName>

                  <ExtendedAttributes>[list of extended attributes]</ExtendedAttributes>

                  <Type>[subscribable type]</Type>

                  <Timeout>

                        <Interval>[heartbeat interval as ULONG]</Interval>

                        <Beats>[max missed heartbeats until timeout]</Beats>

                  </Timeout>

                  <VARIANT xmlns="x-schema:AladdinVariant">

                        XML Variant type as described in XML Schema

                  </VARIANT>

            </Update>

                  :

                  :

      </UpdateInfo>

</ABLSRequest>

 

Response:

<ABLSResponse id="{guid from request}">

      <UpdateInfo type="x10">

            <HRESULTS overall="[hr]">

                  <HR>[hr for entry #1]</HR>

                  <HR>[hr for entry #2]</HR>

                        :

                        :

            </HRESULTS>

      </UpdateInfo>

</ABLSResponse>

 

PeripheralUpdate()

 

Request:

<ABLSRequest id="{unique guid}">

      <UpdateInfo type="peripheral">

            <Update>

                  <DeviceName>[device name]</DeviceName>

                  <CLSID>{clsid of device}</CLSID>

                  <IIDS>

                        <IID>{iid #1}</IID>

                        <IID>{iid #2}</IID>

                              :

                  </IIDS>

                  <LocaleName>[x10 address]</LocaleName>

                  <MachineName>[machine name]</MachineName>

                  <NBLSName>[NBLS announce name]</NBLSName>

                  <ExtendedAttributes>[list of extended attributes]</ExtendedAttributes>

                  <Type>[subscribable type]</Type>

                  <Timeout>

                        <Interval>[heartbeat interval as ULONG]</Interval>

                        <Beats>[max missed heartbeats until timeout]</Beats>

                  </Timeout>

                  <VARIANT xmlns="x-schema:AladdinVariant">

                        XML Variant type as described in XML Schema

                  </VARIANT>

            </Update>

            <Update>

                  <DeviceName>[device name]</DeviceName>

                  <CLSID>{clsid of device}</CLSID>

                  <IIDS>

                        <IID>{iid #1}</IID>

                        <IID>{iid #2}</IID>

                              :

                  </IIDS>

                  <LocaleName>[x10 address]</LocaleName>

                  <MachineName>[machine name]</MachineName>

                  <NBLSName>[NBLS announce name]</NBLSName>

                  <ExtendedAttributes>[list of extended attributes]</ExtendedAttributes>

                  <Type>[subscribable type]</Type>

                  <Timeout>

                        <Interval>[heartbeat interval as ULONG]</Interval>

                        <Beats>[max missed heartbeats until timeout]</Beats>

                  </Timeout>

                  <VARIANT xmlns="x-schema:AladdinVariant">

                        XML Variant type as described in XML Schema

                  </VARIANT>

            </Update>

                  :

                  :

      </UpdateInfo>

</ABLSRequest>

 

Response:

<ABLSResponse id="{guid from request}">

      <UpdateInfo type="peripheral">

            <HRESULTS overall="[hr]">

                  <HR>[hr for entry #1]</HR>

                  <HR>[hr for entry #2]</HR>

                        :

                        :

            </HRESULTS>

      </UpdateInfo>

</ABLSResponse>

 

RemoveEntries()

 

Request:

<ABLSRequest id="{unique guid}">

      <UpdateInfo type="remove">

            <NBLSName>[NBLS announce name]</NBLSName>

            <NBLSName>[NBLS announce name]</NBLSName>

                        :

                        :

      </UpdateInfo>

</ABLSRequest>

 

Response:

<ABLSResponse id="{guid from request}">

      <UpdateInfo type="remove">

            <HRESULTS overall="[hr]">

                  <HR>[hr for entry #1]</HR>

                  <HR>[hr for entry #2]</HR>

                        :

                        :

            </HRESULTS>

      </UpdateInfo>

</ABLSResponse>

 

Lookup()

 

Request:

<ABLSRequest id="{unique guid}">

      <Lookup>

            <NameValuePair>

                  <Name>[name #1]</Name>

                  <Value>[value #1]</Value>

            </NameValuePair>              

            <NameValuePair>

                  <Name>[name #2]</Name>

                  <Value>[value #2]</Value>

            </NameValuePair>              

                        :

                        :

      </Lookup>

</ABLSRequest>

 

Response:

<ABLSResponse id="{guid from request}">

      <Lookup>

            <HR>[hr]</HR>

            <Result device="[first device that satisfied the query]">

                  <Controllers>

                        <Control>

                              <MachineName>[first supporting machine]</MachineName>

                              <NBLSName>[associated NBLS announce name]</NBLSName>

                        </Control>

                        <Control>

                              <MachineName>[first supporting machine]</MachineName>

                              <NBLSName>[associated NBLS announce name]</NBLSName>

                        </Control>

                              :

                  </Controllers>

                  <Locale>

                        <LocaleName>[x10 address]</LocaleName>

                  <NameValuePair>

                        <Name>[name #1]</Name>

                        <Value>[value #1]</Value>

                  </NameValuePair>              

                  <NameValuePair>

                        <Name>[name #2]</Name>

                        <Value>[value #2]</Value>

                  </NameValuePair>              

                              :

                  </Locale>

                  <CLSID>{clsid of device}</CLSID>

                  <IIDS>

                        <IID>{iid #1}</IID>

                        <IID>{iid #2}</IID>

                              :

                  </IIDS>

                  <DeviceCode>[device code as DWORD]</DeviceCode>

                  <ModuleType>[module types as DWORD]</ModuleType>

                  <ExtendedAttributes>[list of extended attributes]</ExtendedAttributes>

                  <Type>[subscribable type]</Type>

                  <Timeout>

                        <Interval>[heartbeat interval as ULONG]</Interval>

                        <Beats>[max missed heartbeats until timeout]</Beats>

                  </Timeout>

                  <VARIANT xmlns="x-schema:AladdinVariant">

                        XML Variant type as described in XML Schema

                  </VARIANT>

            </Result>

            <Result device ="[2nd device that satisfied the query]">

                  <Controllers>

                        <Control>

                              <MachineName>[first supporting machine]</MachineName>

                              <NBLSName>[associated NBLS announce name]</NBLSName>

                        </Control>

                        <Control>

                              <MachineName>[first supporting machine]</MachineName>

                              <NBLSName>[associated NBLS announce name]</NBLSName>

                        </Control>

                              :

                  </Controllers>

                  <Locale>

                        <LocaleName>[x10 address]</LocaleName>

                  <NameValuePair>

                        <Name>[name #1]</Name>

                        <Value>[value #1]</Value>

                  </NameValuePair>              

                  <NameValuePair>

                        <Name>[name #2]</Name>

                        <Value>[value #2]</Value>

                  </NameValuePair>              

                              :

                  </Locale>

                  <CLSID>{clsid of device}</CLSID>

                  <IIDS>

                        <IID>{iid #1}</IID>

                        <IID>{iid #2}</IID>

                              :

                  </IIDS>

                  <DeviceCode>[device code as DWORD]</DeviceCode>

                  <ModuleType>[module types as DWORD]</ModuleType>

                  <ExtendedAttributes>[list of extended attributes]</ExtendedAttributes>

                  <Type>[subscribable type]</Type>

                  <Timeout>

                        <Interval>[heartbeat interval as ULONG]</Interval>

                        <Beats>[max missed heartbeats until timeout]</Beats>

                  </Timeout>

                  <VARIANT xmlns="x-schema:AladdinVariant">

                        XML Variant type as described in XML Schema

                  </VARIANT>

            </Result>

                  :

                  :

      </Lookup>

</ABLSResponse>

 

SubscribeEvents()

 

Request:

<ABLSRequest id="{unique guid}">

      <Subscribe action="set">

            <Subscription type="basic">

                  <NBLSName>[NBLS announce name to subscribe on]</NBLSName>

                  <Callback>[NBLS-based callback address]</Callback>

                  <Flags>[DWORD flags]</Flags>

                  <Timeout>

                        <Interval>[heartbeat interval as ULONG]</Interval>

                        <Beats>[max missed heartbeats until timeout]</Beats>

                  </Timeout>

            </Subscription>

            <Subscription type="basic">

                  <NBLSName>[NBLS announce name to subscribe on]</NBLSName>

                  <Callback>[NBLS-based callback address]</Callback>

                  <Flags>[DWORD flags]</Flags>

                  <Timeout>

                        <Interval>[heartbeat interval as ULONG]</Interval>

                        <Beats>[max missed heartbeats until timeout]</Beats>

                  </Timeout>

            </Subscription>

                  :

                  :

      </Subscribe>

</ABLSRequest>

 

 

Response:

<ABLSResponse id="{guid from request}">

      <Subscribe action="set">

            <HR>[hr]</HR>

            <Response>

                  <HR>[hr]</HR>

                  <GUID>{handle as GUID]</GUID>

            </Response>

            <Response>

                  <HR>[hr]</HR>

                  <GUID>{handle as GUID]</GUID>

            </Response>

                  :

                  :

      </Subscribe>

</ABLSResponse>

 

SubscribeWithQuery()

 

Request:

<ABLSRequest id="{unique guid}">

      <Subscribe action="set">

            <Subscription type="lookup">

            <Lookup>

                  <NameValuePair>

                        <Name>[name #1]</Name>

                        <Value>[value #1]</Value>

                  </NameValuePair>              

                  <NameValuePair>

                        <Name>[name #2]</Name>

                        <Value>[value #2]</Value>

                  </NameValuePair>              

                        :

                        :

            </Lookup>

            <Callback>[NBLS-based callback address]</Callback>

            <Flags>[DWORD flags]</Flags>

            <Timeout>

                  <Interval>[heartbeat interval as ULONG]</Interval>

                  <Beats>[max missed heartbeats until timeout]</Beats>

            </Timeout>

            </Subscription>

      </Subscribe>

</ABLSRequest>

 

Response:

<ABLSResponse id="{guid from request}">

      <Subscribe action="set">

            <HR>[hr]</HR>

            <Response>

                  <HR>[hr]</HR>

                  <GUID>{handle as GUID]</GUID>

            </Response>

      </Subscribe>

</ABLSResponse>

 

UnsubscribeEvents()

 

Request:

<ABLSRequest id="{unique guid}">

      <Subscribe action="remove">

            <GUID>{handle as GUID]</GUID>

            <GUID>{handle as GUID]</GUID>

                        :

                        :

      </Subscribe>

</ABLSRequest>

 

Response:

<ABLSResponse id="{guid from request}">

      <Subscribe action="remove">

            <HRESULTS overall="[hr]">

                  <HR>[hr for entry #1]</HR>

                  <HR>[hr for entry #2]</HR>

                        :

                        :

            </HRESULTS>

      </Subscribe>

</ABLSResponse>

 

INBLSServices Interface

Announce()

 

Request:

<NBLSRequest id="{unique guid}">

      <Announce action="register">

            <NBLSName>[NBLS announce name]</NBLSName>

            <Addresses>

                  <Callback>[callback address #1]</Callback>

                  <Callback>[callback address #2]</Callback>

                  <Callback>[callback address #3]</Callback>

                        :

                        :

            </Addresses>

            <Timeout>

                  <Interval>[heartbeat interval as ULONG]</Interval>

                  <Beats>[max missed heartbeats until timeout]</Beats>

            </Timeout>

      </Announce>

</NBLSRequest>

 

Response:

<NBLSResponse id="{guid from request}">

      <Announce action="register">

            <HR>[hr]</HR>

      </Announce>

</NBLSResponse>

 

Revoke()

 

Request:

<NBLSRequest id="{unique guid}">

      <Announce action="remove">

            <NBLSName>[NBLS announce name]</NBLSName>

      </Announce>

</NBLSRequest>

 

Response:

<NBLSResponse id="{guid from request}">

      <Announce action="remove">

            <HR>[hr]</HR>

      </Announce>

</NBLSResponse>

 

Lookup()

 

Request:

<NBLSRequest id="{unique guid}">

      <Lookup>

            <NBLSName>[NBLS announce name]</NBLSName>

      </Lookup>

</NBLSRequest>

 

Response:

<NBLSResponse id="{guid from request}">

      <Lookup>

            <HR>[hr]</HR>

            <Addresses>

                  <Callback>[callback address #1]</Callback>

                  <Callback>[callback address #2]</Callback>

                  <Callback>[callback address #3]</Callback>

                        :

                        :

            </Addresses>

      </Lookup>

</NBLSResponse>

 

XML Schema

The schema defines the proper syntax for all XML documents transmitted between the ABLS and NBLS clients and servers.

 

<Schema name="AladdinSchema" xmlns="urn:schemas-microsoft-com:xml-data"

                                                          xmlns:dt="urn:schemas-microsoft-com:datatypes"

                                                    xmlns:vt="x-schema:AladdinVariant">

 

<!--the basic elements (those that have no children) are defined first -->

      <ElementType name="HR" content="textOnly" dt:type="ui4"/>

      <ElementType name="LocaleName" content="textOnly" dt:type="string"/>

      <ElementType name="Name" content="textOnly" dt:type="string"/>

      <ElementType name="Value" content="textOnly" dt:type="string"/>

      <ElementType name="DeviceCode" content="textOnly" dt:type="ui4"/>

      <ElementType name="DeviceName" content="textOnly" dt:type="string"/>

      <ElementType name="ModuleType" content="textOnly" dt:type="ui4"/>

      <ElementType name="CLSID" content="textOnly" dt:type="uuid"/>

      <ElementType name="GUID" content="textOnly" dt:type="uuid"/>

      <ElementType name="IID" content="textOnly" dt:type="uuid"/>

      <ElementType name="Type" content="textOnly" dt:type="string"/>

      <ElementType name="ParentType" content="textOnly" dt:type="string"/>

      <ElementType name="MachineName" content="textOnly" dt:type="string"/>

      <ElementType name="NBLSName" content="textOnly" dt:type="string"/>

      <ElementType name="ExtendedAttributes" content="textOnly" dt:type="string"/>

      <ElementType name="Interval" content="textOnly" dt:type="ui4"/>

      <ElementType name="Beats" content="textOnly" dt:type="ui4"/>

      <ElementType name="Callback" content="textOnly" dt:type="string"/>

      <ElementType name="Flags" content="textOnly" dt:type="ui4"/>

 

<!-- basic attributes are now defined -->

      <AttributeType name="action" dt:type="enumeration"

                             dt:values="register set get_all remove"/>

      <AttributeType name="overall"/>

      <AttributeType name="id"/>

      <AttributeType name="type" dt:type="enumeration"

                             dt:values="x10 peripheral remove basic lookup"/>

      <AttributeType name="device" dt:type="string"/>

 

<!--sub-elements are now defined -->

      <ElementType name="HRESULTS" content="eltOnly" model="closed" order="one">

            <attribute type="overall" required="yes"/>

            <element type="HR" minOccurs="0" maxOccurs="*"/>

      </ElementType>

 

      <ElementType name="NameValuePair" content="eltOnly" model="closed"

                            order="seq">

            <element type="Name" minOccurs="1" maxOccurs="1"/>

            <element type="Value" minOccurs="1" maxOccurs="1"/>

      </ElementType>

 

      <ElementType name="Device" content="eltOnly" model="closed" order="seq">

            <element type="DeviceCode" minOccurs="1" maxOccurs="1"/>

            <element type="DeviceName" minOccurs="1" maxOccurs="1"/>

      </ElementType>

 

      <ElementType name="Module" content="eltOnly" model="closed" order="seq">

            <element type="ModuleType" minOccurs="1" maxOccurs="1"/>

            <element type="CLSID" minOccurs="1" maxOccurs="1"/>

            <element type="IID" minOccurs="1" maxOccurs="1"/>

      </ElementType>

 

      <ElementType name="TypeEntry" content="eltOnly" model="closed" order="seq">

            <element type="Type" minOccurs="1" maxOccurs="1"/>

            <element type="ParentType" minOccurs="1" maxOccurs="1"/>

      </ElementType>

 

      <ElementType name="Timeout" content="eltOnly" model="closed" order="seq">

            <element type="Interval" minOccurs="1" maxOccurs="1"/>

            <element type="Beats" minOccurs="1" maxOccurs="1"/>

      </ElementType>

 

      <ElementType name="Control" content="eltOnly" model="closed" order="seq">

            <element type="MachineName" minOccurs="1" maxOccurs="1"/>

            <element type="NBLSName" minOccurs="1" maxOccurs="1"/>

      </ElementType>

 

      <ElementType name="Response" content="eltOnly" model="closed" order="seq">

            <element type="HR" minOccurs="1" maxOccurs="1"/>

            <element type="GUID" minOccurs="1" maxOccurs="1"/>

      </ElementType>

 

      <ElementType name="Locale" content="eltOnly" model="closed" order="seq">

            <element type="LocaleName" minOccurs="1" maxOccurs="1"/>

            <element type="NameValuePair" minOccurs="1" maxOccurs="*"/>

      </ElementType>

 

      <ElementType name="IIDS" content="eltOnly" model="closed" order="one">

            <element type="IID" minOccurs="1" maxOccurs="*"/>

      </ElementType>

 

      <ElementType name="Controllers" content="eltOnly" model="closed" order="one">

            <element type="Control" minOccurs="1" maxOccurs="*"/>

      </ElementType>

 

      <ElementType name="Update" content="eltOnly" model="closed" order="seq">

            <group order="one">

                  <group order="seq">

                        <element type="DeviceCode" minOccurs="1" maxOccurs="1"/>

                        <element type="ModuleType" minOccurs="1" maxOccurs="1"/>

                  </group>

                  <group order="seq">

                        <element type="DeviceName" minOccurs="1" maxOccurs="1"/>

                        <element type="CLSID" minOccurs="1" maxOccurs="1"/>

                        <element type="IIDS" minOccurs="1" maxOccurs="1"/>

                  </group>

            </group>

            <element type="LocaleName" minOccurs="1" maxOccurs="1"/>

            <element type="MachineName" minOccurs="1" maxOccurs="1"/>

            <element type="NBLSName" minOccurs="1" maxOccurs="1"/>

            <element type="ExtendedAttributes" minOccurs="0" maxOccurs="1"/>

            <element type="Type" minOccurs="0" maxOccurs="1"/>

            <element type="Timeout" minOccurs="1" maxOccurs="1"/>

            <element type="vt:VARIANT" minOccurs="1" maxOccurs="1"/>

      </ElementType>

 

      <ElementType name="Subscription" content="eltOnly" model="closed" order="seq">

            <attribute type="type" required="yes"/>

            <group order="one">

                  <element type="NBLSName" minOccurs="1" maxOccurs="1"/>

                  <element type="Lookup" minOccurs="1" maxOccurs="1"/>

            </group>

            <element type="Callback" minOccurs="1" maxOccurs="1"/>

            <element type="Flags" minOccurs="1" maxOccurs="1"/>

            <element type="Timeout" minOccurs="1" maxOccurs="1"/>

      </ElementType>

 

      <ElementType name="Result" content="eltOnly" model="closed" order="seq">

            <attribute type="device" required="yes"/>

            <element type="Controllers" minOccurs="1" maxOccurs="1"/>

            <element type="Locale" minOccurs="1" maxOccurs="1"/>

            <element type="CLSID" minOccurs="1" maxOccurs="1"/>

            <element type="IIDS" minOccurs="1" maxOccurs="1"/>

            <element type="DeviceCode" minOccurs="1" maxOccurs="1"/>

            <element type="ModuleType" minOccurs="1" maxOccurs="1"/>

            <element type="ExtendedAttributes" minOccurs="0" maxOccurs="1"/>

            <element type="Type" minOccurs="1" maxOccurs="1"/>

            <element type="Timeout" minOccurs="1" maxOccurs="1"/>

            <element type="vt:VARIANT" minOccurs="1" maxOccurs="1"/>

      </ElementType>

 

      <ElementType name="Addresses" content="eltOnly" model="closed" order="one">

            <element type="Callback" minOccurs="1" maxOccurs="*"/>

      </ElementType>

 

<!-- major element definitions -->

      <ElementType name="Metadata" content="eltOnly" model="closed" order="one">

            <attribute type="action" required="yes"/>

            <element type="LocaleName" minOccurs="1" maxOccurs="*"/>

            <element type="HRESULTS" minOccurs="1" maxOccurs="1"/>

            <group order="seq">

                  <element type="HR" minOccurs="1" maxOccurs="1"/>

                  <element type="LocaleName" minOccurs="0" maxOccurs="*"/>

            </group>

      </ElementType>

 

      <ElementType name="LocaleInfo" content="eltOnly" model="closed" order="one">

            <attribute type="action" required="yes"/>

            <element type="LocaleName" minOccurs="1" maxOccurs="*"/>

            <element type="HR" minOccurs="1" maxOccurs="1"/>

            <element type="Locale" minOccurs="1" maxOccurs="*"/>

            <element type="HRESULTS" minOccurs="1" maxOccurs="1"/>

            <group order="seq">

                  <element type="HR" minOccurs="1" maxOccurs="1"/>

                  <element type="Locale" minOccurs="0" maxOccurs="*"/>

            </group>

      </ElementType>

 

      <ElementType name="DeviceInfo" content="eltOnly" model="closed" order="one">

            <attribute type="action" required="yes"/>

            <element type="Device" minOccurs="1" maxOccurs="*"/>

            <element type="HR" minOccurs="1" maxOccurs="1"/>

            <element type="DeviceName" minOccurs="1" maxOccurs="1"/>

            <group order="seq">

                  <element type="HR" minOccurs="1" maxOccurs="1"/>

                  <element type="Device" minOccurs="0" maxOccurs="*"/>

            </group>

      </ElementType>

 

      <ElementType name="ModuleInfo" content="eltOnly" model="closed" order="one">

            <attribute type="action" required="yes"/>

            <element type="Module" minOccurs="1" maxOccurs="*"/>

            <element type="HR" minOccurs="1" maxOccurs="1"/>

            <element type="ModuleType" minOccurs="1" maxOccurs="1"/>

            <group order="seq">

                  <element type="HR" minOccurs="1" maxOccurs="1"/>

                  <element type="Module" minOccurs="0" maxOccurs="*"/>

            </group>

      </ElementType>

 

      <ElementType name="SubscribableType" content="eltOnly" model="closed"

                             order="one">

            <attribute type="action" required="yes"/>

            <element type="TypeEntry" minOccurs="1" maxOccurs="*"/>

            <element type="HRESULTS" minOccurs="1" maxOccurs="1"/>

            <element type="Type" minOccurs="1" maxOccurs="1"/>

            <element type="HR" minOccurs="1" maxOccurs="1"/>

            <group order="seq">

                  <element type="HR" minOccurs="1" maxOccurs="1"/>

                  <element type="TypeEntry" minOccurs="0" maxOccurs="*"/>

            </group>

      </ElementType>

 

      <ElementType name="UpdateInfo" content="eltOnly" model="closed" order="one">

            <attribute type="type" required="yes"/>

            <element type="Update" minOccurs="1" maxOccurs="*"/>

            <element type="HRESULTS" minOccurs="1" maxOccurs="1"/>

            <element type="NBLSName" minOccurs="1" maxOccurs="*"/>

      </ElementType>

 

      <ElementType name="Lookup" content="eltOnly" model="closed" order="one">

            <element type="NameValuePair" minOccurs="1" maxOccurs="*"/>

            <element type="NBLSName" minOccurs="1" maxOccurs="1"/>

            <group order="seq">

                  <element type="HR" minOccurs="1" maxOccurs="1"/>

                  <element type="Result" minOccurs="0" maxOccurs="*"/>

            </group>

            <group order="seq">

                  <element type="HR" minOccurs="1" maxOccurs="1"/>

                  <element type="Addresses" minOccurs="0" maxOccurs="1"/>

            </group>

      </ElementType>

 

      <ElementType name="Subscribe" content="eltOnly" model="closed" order="one">

            <attribute type="action" required="yes"/>

            <element type="Subscription" minOccurs="1" maxOccurs="*"/>

            <element type="HRESULTS" minOccurs="1" maxOccurs="1"/>

            <element type="GUID" minOccurs="1" maxOccurs="*"/>

            <group order="seq">

                  <element type="HR" minOccurs="1" maxOccurs="1"/>

                  <element type="Response" minOccurs="0" maxOccurs="*"/>

            </group>

            <group order="seq">

                  <element type="Lookup" minOccurs="1" maxOccurs="1"/>

                  <element type="Callback" minOccurs="1" maxOccurs="1"/>

                  <element type="Flags" minOccurs="1" maxOccurs="1"/>

                  <element type="Timeout" minOccurs="1" maxOccurs="1"/>

            </group>

      </ElementType>

 

      <ElementType name="Announce" content="eltOnly" model="closed" order="one">

            <attribute type="action" required="yes"/>

            <element type="HR" minOccurs="1" maxOccurs="1"/>

            <element type="NBLSName" minOccurs="1" maxOccurs="1"/>

            <group order="seq">

                  <element type="NBLSName" minOccurs="1" maxOccurs="1"/>

                  <element type="Addresses" minOccurs="1" maxOccurs="1"/>

                  <element type="Timeout" minOccurs="1" maxOccurs="1"/>

            </group>

      </ElementType>

 

<!-- root request/response definitions -->

      <ElementType name="ABLSRequest" content="eltOnly" model="closed"

                            order="one">

            <attribute type="id" required="yes"/>

            <element type="Metadata" minOccurs="1" maxOccurs="1"/>

            <element type="LocaleInfo" minOccurs="1" maxOccurs="1"/>

            <element type="DeviceInfo" minOccurs="1" maxOccurs="1"/>

            <element type="ModuleInfo" minOccurs="1" maxOccurs="1"/>

            <element type="SubscribableType" minOccurs="1" maxOccurs="1"/>

            <element type="UpdateInfo" minOccurs="1" maxOccurs="1"/>

            <element type="Lookup" minOccurs="1" maxOccurs="1"/>

            <element type="Subscribe" minOccurs="1" maxOccurs="1"/>

      </ElementType>     

 

      <ElementType name="ABLSResponse" content="eltOnly" model="closed"

                            order="one">

            <attribute type="id" required="yes"/>

            <element type="Metadata" minOccurs="1" maxOccurs="1"/>

            <element type="LocaleInfo" minOccurs="1" maxOccurs="1"/>

            <element type="DeviceInfo" minOccurs="1" maxOccurs="1"/>

            <element type="ModuleInfo" minOccurs="1" maxOccurs="1"/>

            <element type="SubscribableType" minOccurs="1" maxOccurs="1"/>

            <element type="UpdateInfo" minOccurs="1" maxOccurs="1"/>

            <element type="Lookup" minOccurs="1" maxOccurs="1"/>

            <element type="Subscribe" minOccurs="1" maxOccurs="1"/>

      </ElementType>

     

      <ElementType name="NBLSRequest" content="eltOnly" model="closed"

                            order="one">

            <attribute type="id" required="yes"/>

            <element type="Announce" minOccurs="1" maxOccurs="1"/>

            <element type="Lookup" minOccurs="1" maxOccurs="1"/>

      </ElementType>     

 

      <ElementType name="NBLSResponse" content="eltOnly" model="closed"

                            order="one">

            <attribute type="id" required="yes"/>

            <element type="Announce" minOccurs="1" maxOccurs="1"/>

            <element type="Lookup" minOccurs="1" maxOccurs="1"/>

      </ElementType>     

</Schema>

 

Appendix 1: XML Variants

This appendix documents how a VARIANT value will be written to the XML document used in both the ABLS and NBLS wire protocols.  The implementation will be based on the CComVariant() class written and used in the Active Template Library (ATL).  This class will be subclassed to obtain a CComXMLVariant() class that extends its functionality by supporting the following two new methods.

 

(NOTE: The schema must be distributed to all Aladdin installations and preloaded as is done for the main AladdinSchema outlined above.)

HRESULT WriteVARIANTToDOMDocument( IXMLDOMNode* pNode );

This results in the following information written as a child to pNode in the XML document.  The multiple "VT_VALUE" entries are present for VARIANTs that are SAFEARRAYs.  This implementation will support SAFEARRAYs of at most 1 dimension where the array entries are homogenous. (i.e. not VARIANTs themselves.)

 

<VARIANT>

      <VT_TYPE>type as an unsigned short</VT_TYPE>

      <VT_VALUE>string-ized value</VT_VALUE>

      <VT_VALUE>string-ized value</VT_VALUE>

                  :

                  :

</VARIANT>

 

HRESULT ReadVARIANTFromDOMDocument( IXMLDOMNode* pNode );

This reads in the VARIANT that is the child node of the given pNode.  The expected XML format is provided above.

 

VARIANT Schema

The following schema is used to valid the syntax for XML VARIANTs.

 

<Schema name="AladdinVariant" xmlns="urn:schemas-microsoft-com:xml-data"

                                                         xmlns:dt="urn:schemas-microsoft-com:datatypes">

 

      <ElementType name="VT_TYPE" content="textOnly" dt:type="ui2"/>

      <ElementType name="VT_VALUE" content="textOnly" dt:type="string"/>

 

      <ElementType name="VARIANT" content="eltOnly" model="closed" order="seq">

            <element type="VT_TYPE" minOccurs="1" maxOccurs="1"/>

            <element type="VT_VALUE" minOccurs="1" maxOccurs="*"/>

      </ElementType>

</Schema>